package com.agent.commons.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 *  对话身份枚举类
 */
@Getter
@AllArgsConstructor
public enum Agent {

    USER("用户"),
    AI("助手");
    private final String name;

    /**
     * 根据name获取枚举类型
     */
    public static Agent forName(String name){
        for (Agent agent : Agent.values()) {
            if (agent.getName().equals(name)) {
                return agent;
            }
        }
        return null;
    }

}
